package com.zx;

import com.github.rholder.retry.*;
import com.google.common.base.Predicates;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

@RestController
public class SpringController {

    @Autowired
    DemoService demoService;

    @GetMapping("/hello1")
    public String springRetryTest() {
        try {
            demoService.runSpringRetry();
            return "ok";
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return "error";
        }
    }
}
